<?php
/**
 * Created by PhpStorm.
 * User: Simpson
 * Date: 2016/10/14
 * Time: 16:26
 */

namespace App\Model;


use Illuminate\Database\Eloquent\Model;

/**
 * App\Model\Lottery
 *
 * @property-read \App\Model\User $user
 * @property-read \App\Model\Prize $prize
 * @mixin \Eloquent
 */
class Lottery extends Model
{

    protected $table = 'lottery';

    protected $guarded = [];

    public function user()
    {
        return $this->belongsTo('App\Model\User', 'open_id', 'open_id');
    }

    public function prize()
    {
        return $this->belongsTo('App\Model\Prize');
    }
}